
from datetime import *


def getD2Saturday(d:date):
    if d.month>=12:
        d = d.replace(year=d.year + 1,month=1, day=1)
    else:
        d=d.replace(month=d.month+1,day=1)
    d+=timedelta(days=-1)
    count=0
    while count<2:
        if d.weekday()==5:
            count+=1
        if count==2:
            break
        d += timedelta(days=-1)
    return d
if __name__=="__main__":
    # y=datetime.now().year
    # d=date(y,1,1)
    # #while d.weekday()!=6:#找到年初的第一个周日
    # #    d.replace(day=d.day+1)
    # d=d.replace(day=d.day+6-d.weekday() )
    #
    # while d.year==y:
    #     print(d)
    #     d = d+ timedelta(days=7)

    #父亲节
    # y = datetime.now().year
    # d=date(y,6,1)
    # count=0
    # while count<3:
    #     if d.weekday()==6:
    #         count+=1
    #     d += timedelta(days=1)
    #
    # print(d)

    #某个培训结业考试的时间是每月倒数第二个周六上午8点，输出今年的考试时间
    #，用yyyy/MM/dd hh时 的格式输出
    y = datetime.now().year
    for i in range(1,13):
        d=date(y,i,1)
        d=getD2Saturday(d) 
        print(d.strftime("%Y/%m/%d")+" 8时")

